<extend name="Public/layout"/>
<block name="body">
    <div class="builder {$builder_class}">
        <div class="row">
            <notempty name="tab_list">
                <div class="col-xs-12">
                    <ul class="nav nav-tabs">
                        <volist name="tab_list" id="tab">
                            <li class="<php>if($current_tab == $key) echo 'active';</php>"><a href="{:U($tab_url, array('tab' => $key))}">{$tab}</a></li>
                        </volist>
                    </ul>
                    <div class="blank"></div>
                </div>
            </notempty>
            <notempty name="button_list">
                <div class="col-xs-12 col-sm-9 margin-bottom">
                    <volist name="button_list" id="button">
                        <a style="margin-right:5px;" {$button.attr}>89999{$button.title}</a>
                    </volist>
                </div>
            </notempty>
            <notempty name="search">
                <div class="col-xs-12 col-sm-3 margin-bottom">
                    <div class="input-group search-form">
                        <input type="text" name="keyword" class="search-input form-control" value="{$_GET.keyword}" placeholder="{$search.title}">
                        <span class="input-group-btn"><a class="btn btn-default" href="javascript:;" id="search" url="{$search.url}"><i class="glyphicon glyphicon-search"></i></a></span>
                    </div>
                </div>
            </notempty>

            <!-- 数据列表 -->
            <div class="col-xs-12">
                <div class="table-responsive">
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th><input class="check-all" type="checkbox"></th>
                                <th>用户ID</th>
                               <th>微信昵称</th>
                                <th>持卡人姓名</th>
                                <th>金额</th>
                                <th>手机号</th>
                                <th>卡号</th>
                                <th>银行</th>
                                
                                <th>申请时间</th>
                                <th style="text-align: center;">状态</th>
                                <th style="text-align: center;">操作</th>  
                            </tr>
                        </thead>
                        <tbody>
                        <volist name="data_list" id="data">
                            <tr>
                                <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
                                <td>{$data.user_id}</td>
                                 <td>{$data.nickname}</td>
                                <td>{$data.account_name}</td>
                                <td>{$data.total}</td>
                                <td>{$data.phone}</td>
                                <td>{$data.account_bank}</td>
                                <td>{$data.bank_name}</td>
                             
                                <td>{$data.create_time|date="Y-m-d h:i",###}</td>
                                <td style="text-align: center;">
                            <if condition="$data.status eq 1">
                                已处理
                                <else/>
                                未处理
                            </if>
                            </td>
                            <td style="text-align: center;">
                            <if condition="$data.status eq 1">
                                <a class="ajax-get confirm" href="{:U('MemberCash/cancel',array('id'=>$data['id']))}">取消</a>
                                <else/>
                                <a class="ajax-get confirm" href="{:U('MemberCash/grant',array('id'=>$data['id']))}">确认</a>
                            </if>
                            </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                    <ul class="pagination"><notempty name="page">{$page}</notempty></ul>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });

        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
    </script>
</block>


